﻿using System;
using System.Data;
using System.Collections.Generic;
using EnterpriseFund.Model;
namespace EnterpriseFund.BLL
{
    /// <summary>
    /// TaxAuditPolicyEval
    /// </summary>	
    public partial class TaxAuditPolicyEval
    {
        private readonly EnterpriseFund.DAL.TaxAuditPolicyEval dal = new EnterpriseFund.DAL.TaxAuditPolicyEval();
        public TaxAuditPolicyEval()
        { }
        #region  BasicMethod
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void SaveAdd(List<EnterpriseFund.Model.TaxAuditPolicyEval> tAPList, Model.TaxAuditForm tAF)
        {
             dal.SaveAdd(tAPList, tAF);
        }

        public void Invalid(Model.TaxAuditPolicyEval model)
        {
            dal.Invalid(model);
        }

        public void Check(Model.AllowanceIssueEntry model)
        {
            dal.Check(model);
        }

        public void Compute(Model.TaxAuditPolicyEval model, Model.AllowanceIssueEntry model2, string entryType)
        {
            dal.Compute(model, model2, entryType);
        }

              /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public void AddToIssue(List<Model.TaxAuditPolicyEval> taxAuditPolicyEvalList)
        {
            dal.AddToIssue(taxAuditPolicyEvalList);
        }

                /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public void DelToIssue(Model.TaxAuditPolicyEval model)
        {
             dal.DelToIssue(model);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public EnterpriseFund.Model.TaxAuditPolicyEval GetModel(string FTaxAuditId, string FYear, string FTaxClassAllowanceNo)
        {

            return dal.GetModel(FTaxAuditId, FYear, FTaxClassAllowanceNo);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }
        /// <summary>
        /// 获得前几行数据
        /// </summary>
        public DataSet GetList(int Top, string strWhere, string filedOrder)
        {
            return dal.GetList(Top, strWhere, filedOrder);
        }

                /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllowanceIssueEntryListByFIssueID(string issueID)
        {
            return dal.GetAllowanceIssueEntryListByFIssueID(issueID);
        }

               /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetTaxAuditPolicyEvalListByFIssueID(string issueID)
        {
            return dal.GetTaxAuditPolicyEvalListByFIssueID(issueID);
        }

              /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetTaxAuditEntryListByFIssueID(string issueID)
        {
            return dal.GetTaxAuditEntryListByFIssueID(issueID);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.TaxAuditPolicyEval> GetModelList(string strWhere)
        {
            DataSet ds = dal.GetList(strWhere);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.TaxAuditPolicyEval> GetModelQueryList(string strWhere)
        {
            DataSet ds = dal.GetQueryList(strWhere);
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[i]["FInnerRate"].ToString() != "")
                {
                    ds.Tables[0].Rows[i]["FInnerRate"] = decimal.Round(decimal.Parse(ds.Tables[0].Rows[i]["FInnerRate"].ToString()) * 100, 2);
                }
                if (ds.Tables[0].Rows[i]["FOuterRate"].ToString() != "")
                {
                    ds.Tables[0].Rows[i]["FOuterRate"] = decimal.Round(decimal.Parse(ds.Tables[0].Rows[i]["FOuterRate"].ToString()) * 100, 2);
                }
                if (ds.Tables[0].Rows[i]["FAllowanceAmount"].ToString() != "")
                {
                    ds.Tables[0].Rows[i]["FAllowanceAmount"] = decimal.Round(decimal.Parse(ds.Tables[0].Rows[i]["FAllowanceAmount"].ToString()) / 100, 0);
                }
                if (ds.Tables[0].Rows[i]["se"].ToString() != "")
                {
                    ds.Tables[0].Rows[i]["se"] = decimal.Round(decimal.Parse(ds.Tables[0].Rows[i]["se"].ToString()), 0);
                }
            }
                return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<EnterpriseFund.Model.TaxAuditPolicyEval> DataTableToList(DataTable dt)
        {
            List<EnterpriseFund.Model.TaxAuditPolicyEval> modelList = new List<EnterpriseFund.Model.TaxAuditPolicyEval>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                EnterpriseFund.Model.TaxAuditPolicyEval model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetAllList()
        {
            return GetList("");
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public int GetRecordCount(string strWhere)
        {
            return dal.GetRecordCount(strWhere);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        //public DataSet GetList(int PageSize,int PageIndex,string strWhere)
        //{
        //return dal.GetList(PageSize,PageIndex,strWhere);
        //}

        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}

